/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package elevatronic.models;

import elevatronic.utils.Utils.Direction;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Exosta
 */
public class Elevator {
    
	//TODO Guillaume, are you ok to calculate speed in this unity, meter don't have sense in this simulation
    // Speed elevator stated in floor per cycle (step (in update) is a coefficient of cycle number)
    public static final double SPEED = 0.2;
    // Stopping time at a floor stated in second
    public static final double STOPPING_TIME = 1.0;
            
    int id;
    Direction direction; // -1, 0 or 1
    int currentFloor;
    int currentStep;

    public int getCurrentStep() {
        return currentStep;
    }

    public void setCurrentStep(int currentStep) {
        this.currentStep = currentStep;
    }
    
    int targettedFloor;
    // Next floor to focus after the current
    Floor waitingTargettedFloor;
    List<Button> floorButtons;
    List<People> peopleInElevator;
    
    //remaining time to reach the destination
    private int remainingTime;
    //time to reach destination, so when the elevator beggin a trip to another floor, remainingTime = timeToMakeTheTrip
    private int timeToMakeTheTrip;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
    
    public Elevator(int id){
        //this.currentFloor = new Floor(0);
        this.currentStep = 0;
    	setFloorButtons(new ArrayList<Button>());
    	setPeopleInElevator(new ArrayList<People>());
    	setId(id);
    	for(int i=0;i<10;i++){
    		getFloorButtons().add(new Button());
    	}
    }

    public Direction getDirection() {
        return direction;
    }
    
    public int getCurrentFloor() {
        return currentFloor;
    }

    public void setCurrentFloor(int currentFloor) {
        this.currentFloor = currentFloor;
    }
    
    public int getTargettedFloor() {
        return targettedFloor;
    }

    public void setTargettedFloor(int targettedFloor) {
        this.targettedFloor = targettedFloor;
    }

    public void setDirection(Direction direction) {
        this.direction = direction;
    }

    public List<Button> getFloorButtons() {
        return floorButtons;
    }

    public void setFloorButtons(List<Button> floorButtons) {
        this.floorButtons = floorButtons;
    }

    public List<People> getPeopleInElevator() {
        return peopleInElevator;
    }

    public void setPeopleInElevator(List<People> peopleInElevator) {
        this.peopleInElevator = peopleInElevator;
    }

    public int getRemainingTime() {
            return remainingTime;
    }

    public void setRemainingTime(int remainingTime) {
            this.remainingTime = remainingTime;
    }

    public int getTimeToMakeTheTrip() {
            return timeToMakeTheTrip;
    }

    public void setTimeToMakeTheTrip(int timeToMakeTheTrip) {
            this.timeToMakeTheTrip = timeToMakeTheTrip;
    }
    
    
}
